<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/12/14
 * Time: 9:48
 */

namespace app\common\validate;

use think\Validate;


class LeaveMessageValidate extends Validate
{
    protected $rule = [
        "username" => "require|max:25",
        'email' => 'email',
        'phone'=>['regex'=>'/^((\+?86)|(\(\+86\)))?\d{3,4}-\d{7,8}(-\d{3,4})?$|^((\+?86)|(\(\+86\)))?1\d{10}$/'],
        'address' => 'max:60',
    ];

    protected $message = [
        'username.require' => '用户名必须存在',
        'username.max' => '用户名能超过25个字符',
        'email' => '邮箱格式错误',
        'phone' => '用户联系方式错误',
        'address' => '用户地址不能超过60个字符',
    ];
}